package cn.derry.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author mango
 * @date 2017/12/21
 */
public class UrlPattenServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    /**
     * @see HttpServlet#HttpServlet()
     */
    public UrlPattenServlet() {
        super();
        System.out.println(" UrlPattenServlet 初始化成功");
    }

    /**
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setAttribute("urlPatten", request.getRequestURL());
        request.getRequestDispatcher("/url.jsp").forward(request, response);
    }

}
